package org.budo.datasource.routing.impl;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;

import org.budo.datasource.routing.BudoRoutingDataSource;
import org.budo.datasource.routing.exception.BudoRoutingDataSourceNotSupportedException;

/**
 * @author lmw
 */
public abstract class NotSupportedBudoRoutingDataSource implements BudoRoutingDataSource {
    @Override
    public Connection getConnection(String username, String password) throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException("username=" + username + ", password=" + password);
    }

    @Override
    public PrintWriter getLogWriter() throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException();
    }

    @Override
    public void setLogWriter(PrintWriter out) throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException("out=" + out);
    }

    @Override
    public void setLoginTimeout(int seconds) throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException("seconds=" + seconds);
    }

    @Override
    public int getLoginTimeout() throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException();
    }

    @Override
    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        throw new BudoRoutingDataSourceNotSupportedException();
    }

    @Override
    public <T> T unwrap(Class<T> iface) throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException("iface=" + iface);
    }

    @Override
    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        throw new BudoRoutingDataSourceNotSupportedException("iface=" + iface);
    }
}